<%@ page contentType="text/html; charset=utf-8" language="java"
	pageEncoding="UTF-8" errorPage=""%>
<%@ page isELIgnored="false" %>
<%@ include file="/web/common/taglibs.jsp"%>
<%@ taglib prefix="p" uri="/pagination-tags"%> 
<sx:head/>
<s:head/>
<link href="web/css/global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="web/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="web/js/common.js"></script>
<script><!--
$().ready(function(){
	initScrollList('dv');
});
function clickEdit(id){
	window.showModalDialog("jfAdminMember!popMemberEdit.action?editUserId=" + id,"window","unadorned:no;help:no;status:no;scroll:yes;resizable:no;dialogWidth:500px;dialogHeight:400px;");
}
function popMemberCreate(){
	window.showModalDialog("jfAdminMember!popMemberCreate.action","window","unadorned:no;help:no;status:no;scroll:yes;resizable:no;dialogWidth:500px;dialogHeight:400px;");
}
function beforeDelete(){
	if($("TBODY").find(":checkbox:checked").length <= 0){
		alert('请选择要删除的用户！');
		return false;
	} else {
		return confirm('是否确定要删除选中的用户？');
	}
}
function selectAllUser(){
	if($("#checkAll").attr("checked")){
		$("#dv").find(":checkbox").each(function(){
			$(this).attr("checked",false);
		});
	} else {
		$("#dv").find(":checkbox").each(function(){
			$(this).attr("checked",true);
		})
	}
	
}
--></script>
<s:form action="jfAdminMember" method="post">
	<s:hidden id="editUserId" name="memberForm.editUserId"></s:hidden>
	
	<div class="div-title" style="width:100%">&nbsp;<s:property
		value='%{getText("msg_admin_member_title")}' /></div>
	<div class="div-group" style="margin-top: 10px;">
	<table class="tb-common" width="94%"
		border="0">
		<tr>
			<td class="tb-label2" width="80px">
				<p class="p-label"><s:property value='%{getText("msg_admin_member_user_id")}' /></p>
			</td>
			<td width="20%">
				<s:textfield name="memberForm.searchUserId"  cssClass="txt-common"></s:textfield>
			</td>
			<td class="tb-label2" width="80px">
				<p class="p-label"><s:property value='%{getText("msg_admin_member_nickname")}' /></p>
			</td>
			<td width="20%">
				<s:textfield name="memberForm.searchNickname" cssClass="txt-common"></s:textfield>
			</td>
			<td></td>
		</tr>
		<tr>
			<td class="tb-label2" width="80px">
				<p class="p-label"><s:property value='%{getText("msg_admin_member_email")}' /></p>
			</td>
			<td width="20%">
				<s:textfield name="memberForm.searchEmail"  cssClass="txt-common"></s:textfield>
			</td>
			<td class="tb-label2" width="80px">
				<p class="p-label"><s:property value='%{getText("msg_admin_member_role")}' /></p>
			</td>
			<td width="20%">
				<s:select name="memberForm.searchRoleId" cssClass="select-common" cssStyle="width:100px"
						list="memberForm.roleList" headerKey="" headerValue=""
						listKey="value" listValue="label">
				</s:select>
			</td>
			<td class="tb-label2" width="80px">
				<p class="p-label"><s:property value='%{getText("msg_admin_member_disabled")}' /></p>
			</td>
			<td width="20%">
				<s:select name="memberForm.searchDisabled" cssClass="select-common" cssStyle="width:100px"
						list="memberForm.disabledList" headerKey="" headerValue="" listKey="value" listValue="label">
				</s:select>
			</td>
			<td></td>
		</tr>
		<tr>
			<td>
				<p class="p-label"><s:property value='%{getText("msg_admin_member_insert_date_from")}' /></p>
			</td>
			<td>
				<table cellpadding="0" cellspacing="0">
					<sx:datetimepicker name="memberForm.searchInsertDateFrom" 
						cssClass="txt-common"
						cssStyle="width:130px;"
						toggleType="explode" 
						value="today" 
						type="date"
						label='' 
						displayFormat="yyyy/MM/dd" />
				</table>
			</td>
			<td>
				<p class="p-label"><s:property value='%{getText("msg_admin_member_insert_date_to")}' /></p>
			</td>
			<td>
				<table cellpadding="0" cellspacing="0">
					<sx:datetimepicker name="memberForm.searchInsertDateTo"
						cssClass="txt-common"
						cssStyle="width:130px;"
						toggleType="explode" 
						value="today" 
						type="date"
						label='' 
						displayFormat="yyyy/MM/dd" />
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="2" nowrap="nowrap">
				<s:submit method="doSearch" cssClass="btn-90"  value='%{getText("btn_search")}' />
				<input type="button" id="createBtn" class="btn-90" onclick="popMemberCreate()" value="<s:property value='%{getText("btn_new")}'/>" />
				<s:submit id="deleteBtn" cssClass="btn-90" method="doDeleteMembers" onclick="return beforeDelete()" value="%{getText('btn_delete')}" />
			</td>
			<s:if test="total > 0">
			<td colspan="2" nowrap="nowrap" style="text-align:center;">
				共&nbsp;<s:property value="total"/>&nbsp;页 &nbsp;&nbsp;第&nbsp;<s:property value="pageNo"/>&nbsp;页
			</td>
			<td colspan="3" nowrap="nowrap" style="text-align:left;">
				<p:pages pageNo="pageNo" total="total" url="jfAdminMember!doSearch.action" styleClass="page" theme="number">
				</p:pages>			
			</td>
			</s:if>
		</tr>
	</table>
	<div id="dv" class="div-scroll" style="height:50%;width:99%;margin-top:10px;">
		<table border="0" cellpadding="0" cellspacing="0" style="width:98%;position: relative;">
			<tr>
				<td class="td-list-title-left2" style="width:50px;">
					<div class="label-div-title">
						<input type="checkbox" onclick="selectAllUser()" id="selectAllCheckbox"/>
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_user_id")}' />
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_user_name")}' />
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_role")}' />
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_email")}' />
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_insert_date")}' />
					</div>
				</td>
				<td class="td-list-title-center2">
					<div class="label-div-title">
						<s:property value='%{getText("msg_admin_member_disabled")}' />
					</div>
				</td>
				<td class="td-list-title-right2" style="width:60px;">
					<div class="label-div-title">
					</div>
				</td>
			</tr>
			<tbody>
			<s:iterator value="memberForm.userList" status="ul" >
			<tr>
				<td class="td-list-content-left" style="text-align:center;">
					<input type="checkbox" id="checkAll" name="memberForm.editUserArray" value="<s:property value='userId' />"/>
				</td>
				<td class="td-list-content-right">
					<s:property value='userId' />
				</td>
				<td class="td-list-content-right">
					<s:property value='userName' />
				</td>
				<td class="td-list-content-right">
					<s:property value='roleName' />
				</td>
				<td class="td-list-content-right">
					<s:property value='emailAddress' />
				</td>
				<td class="td-list-content-right" style="text-align:center;">
					<s:text name="global.format.date" ><s:param value="insertDate"/></s:text>
				</td>
				<td class="td-list-content-right" style="text-align:center;">
					<s:if test="{disabled == 0}">
						<s:property value='%{getText("global.boolean.no")}' />
					</s:if>
					<s:else>
						<s:property value='%{getText("global.boolean.yes")}' />
					</s:else>
				</td>
				<td class="td-list-content-right" style="text-align:center;">
					<input type="button" onclick="clickEdit('<s:property value="userId" />');" value='<s:property value="%{getText('btn_edit')}" />'/>
				</td>
			</tr>
			</s:iterator>
			</tbody>
		</table>
	</div>

	<br>

	</div>
</s:form>
</html>
